package avicit.bdp.dgs.mdm.service;

import avicit.bdp.common.base.BaseService;
import avicit.bdp.dgs.mdm.dao.MdataRApplicationDao;
import avicit.bdp.dgs.mdm.dto.MdataRApplicationDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @金航数码科技有限责任公司
 * @作者：${tableInfo.classCreator}
 * @邮箱：${tableInfo.classMailbox}
 * @创建时间： 2023-12-22 16:02
 * @类说明：
 * @修改记录：
 */
@Service
public class MdataRApplicationService extends BaseService<MdataRApplicationDao, MdataRApplicationDTO> {

    private static final Logger logger = LoggerFactory.getLogger(MdataRApplicationService.class);

    @Autowired
    private MdataRApplicationDao mdataRApplicationDao;

    /**
     * 查询系统对应的主数据列表
     *
     * @return 列表
     */
    @Transactional(readOnly = true)
    public List<MdataRApplicationDTO> getMDataList(String mdataId) {
      return mdataRApplicationDao.getMDataList(mdataId);
    }

    @Transactional
    public void deleteMdataByApplicationId(String applicationId) {
        mdataRApplicationDao.deleteMdataByApplicationId(applicationId);
    }

    /**
     * 根据系统ID查询主数据列表
     * @param applicationId
     * @return
     */
    @Transactional(readOnly = true)
    public List<MdataRApplicationDTO> queryMDataListByAppId(String applicationId) {
        return mdataRApplicationDao.queryMDataListByAppId(applicationId);
    }

}
